import { Injectable } from '@angular/core';
import { HttpService } from '../HTTP/http.service';
import { HttpParams } from '@angular/common/http';

import { configmanageApirequestInterface } from './interface/configmanage.apirequest.interface';

@Injectable()
export class ConfigmanageApirequest implements configmanageApirequestInterface {
  async getAppConfigItem(key: string, appId: string): Promise<any> {
    return this.http.get('/api/config/manage/GetItem', { key, appId });
  }
  getAppConfigItems(keys: string[], appId: string): Promise<any> {
    return this.http.get('/api/config/manage/GetItems', { keys, appId });
  }
  getAppConfigAllItems(appId: string): Promise<any> {
    return this.http.get('/api/config/manage/GetAllItems', { appId });
  }
  createConfig(Key: string, Value: string, AppId: string): Promise<any> {
    return this.http.post('/api/config/manage/Create', { Key, Value, AppId });
  }
  deleteConfig(Key: string, AppId: string): Promise<any> {
    return this.http.post('/api/config/manage/Delete', { Key, AppId });
  }
  updateConfig(Key: string, Value: string, AppId: string): Promise<any> {
    return this.http.post('/api/config/manage/Update', { Key, Value, AppId });
  }

  constructor(private http: HttpService) {
  }

}